package com.numbfish.ch_03.stack_2_new.src.test.run;

import com.numbfish.ch_03.stack_2_new.src.service.C;
import com.numbfish.ch_03.stack_2_new.src.service.P;
import com.numbfish.ch_03.stack_2_new.src.entity.MyStack;
import com.numbfish.ch_03.stack_2_new.src.extthread.C_Thread;
import com.numbfish.ch_03.stack_2_new.src.extthread.P_Thread;

public class Run {
	public static void main(String[] args) throws InterruptedException {
		MyStack myStack = new MyStack();

		P p = new P(myStack);

		C r1 = new C(myStack);
		C r2 = new C(myStack);
		C r3 = new C(myStack);
		C r4 = new C(myStack);
		C r5 = new C(myStack);

		P_Thread pThread = new P_Thread(p);
		pThread.start();

		C_Thread cThread1 = new C_Thread(r1);
		C_Thread cThread2 = new C_Thread(r2);
		C_Thread cThread3 = new C_Thread(r3);
		C_Thread cThread4 = new C_Thread(r4);
		C_Thread cThread5 = new C_Thread(r5);
		cThread1.start();
		cThread2.start();
		cThread3.start();
		cThread4.start();
		cThread5.start();
	}

}